//
// Created by 吴喆 on 2020/4/8.
//

#ifndef SUMMER_SMLABEL_H
#define SUMMER_SMLABEL_H


#include "FontAtlas.h"
#include "GameObject.h"
#include <string>

class SMLabel : public GameObject {
public:
    explicit SMLabel(Scene *scene, glm::vec2 position, float scale, std::wstring &content);
    explicit SMLabel(Scene *scene, glm::vec2 position, float scale, std::wstring &&content);

    ~SMLabel() override;

    static void setFontAtlas(FontAtlas *fontAtlas);

    void setContent(const std::wstring &content);

    virtual void init() final;

    void update() override;

    void render() override;

    void initGameObject() override;

    void initRenderer() override;


protected:
    static FontAtlas *fontAtlas;

private:
    std::wstring content;
    std::unordered_map<wchar_t, Character*> chs;

};


#endif //SUMMER_SMLABEL_H
